home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 109
/
Vol 109.iso
/
games
/
free_sty.swf
/
scripts
/
DefineSprite_164
/
frame_105
/
DoAction.as
Wrap
Text File
|
2008-11-12
|
654b
|
30 lines
var vv = 15;
var mxx = _root.bg_mc.man._x;
var myy = _root.bg_mc.man._y;
var bxx = _root.zhu_array[_root.level][this.downn][0];
var byy = _root.zhu_array[_root.level][this.downn][1];
if((mxx - bxx) * (mxx - bxx) + (myy - byy) * (myy - byy) > this.vv * this.vv)
{
var jj = Math.atan2(byy - myy,bxx - mxx);
this._x += this.vv * Math.cos(jj);
this._y += this.vv * Math.sin(jj);
}
else
{
this._x = bxx;
this._y = byy;
if(this.nn51 > 6)
{
this.gotoAndPlay("Φ╖│τ┐╗l");
}
else
{
this.gotoAndPlay("Φ╖│τ┐╗d");
}
}
if(Key.isDown(40))
{
this.nn51 = -1000000;
}
this.nn51 = this.nn51 + 1;